#pragma once

struct Camera3D {
	Camera3D() : m_position( makeVector3f(0.f, 0.f, 0.f) ), m_rotation( makeMatrix3f( 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f ) ) {}

	 Matrix4f getViewMatrix() const {
		   //Matrix3f camCoords;
		  // camCoords[0] = orthoNormRightDirection;
		   //camCoords[1] = orthoNormUpDirection;
		   //camCoords[2] = orthoNormViewDirection;
		   Matrix4f camTranslate = makeTranslation4f(-m_position);
		   return expand3To4(m_rotation.transpose())*camTranslate;
	 }

	 Matrix3f getRotation() { return m_rotation; }

	inline Vector3f getPosition() const {return m_position;}
	inline void setPosition( const Vector3f& v ) { m_position = v; }
	inline Vector3f getOrthoNormViewDirection() const {return m_rotation[2];}
	inline Vector3f getOrthoNormRightDirection() const {return m_rotation[0];}
	inline Vector3f getOrthoNormUpDirection() const {return m_rotation[1];}

	inline void setOrthoNormViewDirection(const Vector3f& v) { m_rotation[2] = v;}
	inline void setOrthoNormRightDirection(const Vector3f& v) { m_rotation[0] = v;}
	inline void setOrthoNormUpDirection(const Vector3f& v)  { m_rotation[1] = v;}
private:
	Matrix3f m_rotation;

	Vector3f m_position;
};